package pluginMain;

import java.util.logging.Logger;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import skill.SkillManager;

public class Perfix extends JavaPlugin {
	public final String PLUGIN_NAME = "RemiliaNetwork Lore";
	public final Logger CONSOLE_LOGGER = this.getLogger();
	
	public void LOGCONSOLE(String msg){
		CONSOLE_LOGGER.info(msg);
	}
	
	public static SkillManager sm;
	public static Perfix instance;

	@Override
	public void onEnable(){
		instance = this;

		RegisteredServiceProvider<SkillManager> service = getServer()
				.getServicesManager().getRegistration(SkillManager.class);
		if(service == null){
			LOGCONSOLE("Require SP plugin first");
			setEnabled(false);
			return;
		}
		sm = service.getProvider();
		if(sm == null){
			LOGCONSOLE("Can't get instance of SkillManager in SP");
			setEnabled(false);
			return;
		}

		LOGCONSOLE(PLUGIN_NAME + " has been started.");
	}
	
	@Override
	public void onDisable(){
		LOGCONSOLE(PLUGIN_NAME + " has been disabled.");
	}
	
	@Override
	public boolean onCommand(CommandSender sender, Command command,
			String label, String[] args) {
		
		return false;
	}
}
